package com.cqhfan.imservice.controller;

import com.cqhfan.imservice.service.ChatGroupService;
import com.cqhfan.pojo.im.dto.CreateGroupDTO;
import com.cqhfan.pojo.im.vo.ChatGroupInfoVO;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @author 眭传洪
 * @create 2025-08-17 0:07
 */
@RestController
@RequestMapping("/chatGroup")
@RequiredArgsConstructor
public class ChatGroupController {

    private final ChatGroupService chatGroupService;

    @PostMapping("/createChatGroup")
    public Long createChatGroup(@RequestBody CreateGroupDTO body) {
        return chatGroupService.createChatGroup(body);
    }

    @GetMapping("/getChatGroupInfo/{groupId}")
    public ChatGroupInfoVO getChatGroupInfo(@PathVariable("groupId") Long groupId) {
        return chatGroupService.getChatGroupInfo(groupId);
    }

}
